﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.ComponentModel;
using VsxFactory.Modeling.VisualStudio;
using VsxFactory.Modeling.Strategies;

namespace VsxFactory.Modeling.StrategyManager.Strategies
{
    [ClassInterface(ClassInterfaceType.AutoDispatch), ComVisible(true)]
    public class DependencyFileStrategyModelExtender : BaseStrategyExtender 
    {
        [Browsable(false)]
        public IEnumerable<Lazy<Modeling.Strategies.IGenerationStrategy, Modeling.Strategies.IStrategyMetadata>> Strategies { get; private set; }

         public DependencyFileStrategyModelExtender(IServiceProvider serviceProvider, IVsProjectFileItem item, IEnumerable<Lazy<Modeling.Strategies.IGenerationStrategy, Modeling.Strategies.IStrategyMetadata>> strategies)
             : base(serviceProvider, item)
         {
             this.Strategies = strategies;
         }

         [Browsable(true)]
         [DisplayName("Strategy name")]
         [Category("Code generation")]
         [Editor(typeof(StrategyNameEditor), typeof(System.Drawing.Design.UITypeEditor))]      
         [Description("Strategy name to execute when the document is closed or when the model is modified.")]
         public string StrategyName
         {
             get
             {
                 return this.Item.GetAttribute("MXStrategyName");
             }
             set
             {
                 this.Item.SetAttribute("MXStrategyName", value);
             }
         }
    }
}
